/*
   \file  settings.cc
   \brief Various global libgist settings.

   This file implements the API encapsulating various global settings
   applicable to all the algorithms available in libgist. See its header
   file for more info.
*/

/*
   This file is part of libgist.

   libgist is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   libgist is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
   for more details.

   You should have received a copy of the GNU General Public License
   along with libgist; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/

/*
   REVISION HISTORY

   $HeadURL: http://libgist.googlecode.com/svn/branches/wu_dev/src/settings.cc $
   $Id: settings.cc 71 2011-09-29 06:22:25Z libgist@gmail.com $
*/

//------------------------------ HEADERS --------------------------------

// libgist
#include "settings.hh"

// Standard C++
#include <algorithm>

//----------------------- NAMESPACE DEFINITION --------------------------

namespace gist {

//------------------------- NUMBER OF THREADS ---------------------------

static int g_num_threads = 1 ;

void num_threads(int n)
{
   g_num_threads = std::max(n, 1) ;
}

int num_threads()
{
   return g_num_threads ;
}

//-----------------------------------------------------------------------

} // end of namespace encapsulating this file's definitions

/* So things look consistent in everyone's emacs... */
/* Local Variables: */
/* indent-tabs-mode: nil */
/* End: */

